<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="de.openlaboratory.elib.model.library.*" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%
	Library lib = (Library) request.getAttribute("param");
	String forwardAction = (String) request.getAttribute("elib_action");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>Library Servlet</title>
	<style>.error { color: red; } .success { color: green; }</style>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>
	<form action="library" method="post">
            <h1>Edit Library</h1>
		<p>
			<label for="name">Library name</label>
			<input id="name" name="name" value="<%= lib.getName() %>" />
			<span class="error">${messages.name}</span>
		</p>
		<p>
			<label for="description">Description</label>
			<input id="description" name="description" value="<%= lib.getDescription() %>" />
			<span class="error">${messages.description}</span>
		</p>
		<p>
			<label for="key">Key</label>
			<input id="key" name="key" value="<%= lib.getNumericKey() %>" />
			<span class="error">${messages.key}</span>
		</p>
		<p>
			<input type="hidden" name="action" value="EDIT" />
			<input type="hidden" name="id" value="<%= lib.getId() %>" />
			<input type="hidden" name="elib_action" value="<%= request.getAttribute("elib_action") %>" />
			<input type="hidden" name="elib_ns" value="<%= Library.class %>" />
			<input type="submit">
			<span class="success">${messages.success}</span>
		</p>
	</form>
</body>
</html>